import request from '@/utils/request'

/**  Sxz
 * 通过会员ID获取会员信息及积分变动、签到记录
 * @param {Number|String} userId 会员ID
 * @returns Promise
 */
export function getMemberDetails(userId) {
  return request({
    url: `/core/members/${userId}/details`,
    method: 'get'
  })
}


// 查询会员id查询收货地址
export function listShippingAddress(membersId) {
  return request({
    url: `/core/members/shippingAddress/`+ membersId,
    method: 'get'
  })
}

// 查询会员信息列表
export function listMembers(query) {
  return request({
    url: '/core/members/list',
    method: 'get',
    params: query
  })
}

// 查询会员信息详细
export function getMembers(id) {
  return request({
    url: '/core/members/' + id,
    method: 'get'
  })
}

// 新增会员信息
export function addMembers(data) {
  return request({
    url: '/core/members',
    method: 'post',
    data: data
  })
}

// 修改会员信息
export function updateMembers(data) {
  return request({
    url: '/core/members',
    method: 'put',
    data: data
  })
}

// 删除会员信息
export function delMembers(id) {
  return request({
    url: '/core/members/' + id,
    method: 'delete'
  })
}
